<template>
  <div class="fullMain">
    <x-header :left-options="{backText: '',showBack: false}" >
      未提交罚款记录
    </x-header>
    <div v-transfer-dom>
      <alert v-model="isShowAlert" :content="alertText"></alert>
    </div>
    <div style="height:20px"/>
    <load-more v-if="isShowLoadMore" :tip="tipOfPayLoading"></load-more>
    <div class="mainbBg" v-else>
      <div v-if="!isShowFineList" style="text-align:center">
        <label>—————— 您目前无未提交的罚款 ——————</label>
      </div>
    </div>
  </div>
</template>
<script>
import {XHeader, LoadMore, Panel} from 'vux'
import group from 'api/group'
import user from 'api/user'
import wx from 'api/wx'
import common from 'utilMethods/common.js'
export default {
  name: 'U_fine_order_page',
  data() {
    return {
      openid: '',
      alertText: '', // 验证提示框的文本
      isShowAlert: false, // 是否显示验证提示框
      tipOfPayLoading: '支付处理中，请耐心等待...',
      isShowLoadMore: false,
      isShowFineList: false,

      groupId: 0,
      time: '',
    }
  },
  components: {
    XHeader,
    LoadMore,
    Panel
  },
  mounted() {
    this.getFineOrders();
  },
  methods: {
    back () {
      this.$router.go(-1);
    },
    showAlert (alertText){
      this.isShowAlert = true
      this.alertText = alertText
    },
    closeTip (){
      this.isShowAlert = false
      this.alertText = ''
    },
    async getFineOrders () {
      let openId = window.localStorage.getItem('openId');
      const res = await wx.postQueryFine({openid: openId});
      console.log(res);
      if (res.length === 0) {
        this.isShowFineList = false;
      } else {
        this.isShowFineList = true;
      }
    }
  },
}
</script>
